using UnityEngine;
using System.Collections;

public class ArrowForLance : MonoBehaviour {

    public AudioClip clip;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void OnCollisionEnter(Collision collided)
    {
        if (collided.gameObject.layer == Const.LAYER_PLAYER )
        {
            collided.gameObject.GetComponent<Archeologist>().suicideMe();
            this.gameObject.SetActive(false);
            AudioSource.PlayClipAtPoint(clip, this.transform.position);
        }
        if (collided.gameObject.layer == Const.LAYER_WALL)
        {
            this.gameObject.SetActive(false);
            AudioSource.PlayClipAtPoint(clip, this.transform.position);
        }
    }
}
